<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
	<meta charset="UTF-8">
	<title>Document</title>
	<link rel="stylesheet" href="/js/plugin/layui-v2.3.0/layui/css/layui.css">
	<link rel="stylesheet" href="/css/reset.css">
	<link rel="stylesheet" href="/css/index.css">
	<link rel="stylesheet" href="/css/project_set.css">
	<script src="/js/jquery-2.1.1.min.js"></script>
	<script src="/js/plugin/layui-v2.3.0/layui/layui.js"></script>
	<script src="/js/common.js"></script>
<script>
	$(document).ready(function() {
		var projectId = $("#projectId").val();
		
		initFormSelects("fkTeam","/app/customerTeam/selectjson/"+projectId,"");
		
	});
	
</script>
<style>
.layui-form-label{
	text-align:left
}
.kb-form-container{
	padding-left:20px;
}
.layui-form-item .layui-inline{
	margin-right:0px
}
</style>
<script type="text/javascript">
</script>
</head>
<body style="overflow-y:scroll">
<form  class="layui-form" id="defaultForm"  lay-filter="employee-form">
	<div class="layui-form-item">
		<div class="layui-inline" style="margin-top:30px">
		    <label class="layui-form-label"><span class="must-fill">*</span>分店团队</label>
		    <div class="layui-input-inline" style="width:330px">
		      	<select name="fkTeam" id="fkTeam" lay-filter="team" >
		      	<option value="">选择团队</option>
			    </select>
		    </div>
		</div>
		</div>
			<div class="layui-form-item" style="">
			    <div class="layui-input-block">
			      <button class="layui-btn layui-btn-normal btn-bg" lay-submit lay-filter="formEmployee" id="submit-btn">提交</button>
			      <a class="layui-btn layui-btn-primary" onclick="closeLayer()">取消</a>
			    </div>
			</div>
	<input id="projectId" th:value="${projectId}" hidden="hidden">		
	</form>		
</body>
<script>
$(function(){	
	
	
	layui.config({
	        base: '/js/plugin/layui-v2.3.0/layui/' //此处路径请自行处理, 可以使用绝对路径
	    }).extend({
	        formSelects: 'formSelects-v3'
	    }).use(['element',"layer",'formSelects'], function(){
			var layer=layui.layer,form = layui.form,formSelects = layui.formSelects;
			//监听提交
			  form.on('submit(formEmployee)', function(data){
				  var fkTeam = $("#fkTeam").val();
				  var projectId = $("#projectId").val();
				  if(fkTeam == ""){
					  layer.msg("分店不能为空");
					  
				  }else{
					  var iframeSrc = "/app/contractInfo/addDetails/"+projectId+"_"+fkTeam;
					  closeLayer();
					  var iframe =window.parent.document.getElementById("iframe-top");
					  //var obj = iframe.contentWindow;
					  //var iframeNew = iframe.contentWindow.document.getElementById("project-iframe");
					  /* console.log(projectId);
					  if(iframeNew){
						  console.log(projectId); */
						  iframe.src = iframeSrc;
					  /* }else{
						  iframe.src = iframeSrc; 
					  } */
					  
				  }
					return false;
			  });
			
			
			  
			}); 
	
	
})
</script>
</html>